import requests

login_url = "https://www.aimtes.xyz/api/v1/pwd_login"
sign_url = "https://www.aimtes.xyz/api/v1/user/sign"

# 登录参数
login_payload = {
    "phone": "17620084608",
    "login_pdw": "asd1234567",
    "sign": "7E941261FE6662EC5561F90762B2190B",
    "timestamp": 1702956948
}

# 发送登录请求
login_response = requests.post(login_url, json=login_payload)

# 检查登录是否成功
if login_response.status_code == 200:
    # 提取登录后的token
    try:
        token = login_response.json()["data"]["token"]
    except KeyError:
        print("登录失败，未找到token信息")
        print("响应内容:")
        print(login_response.text)
        exit()

    # 隐藏登录信息，设置User-Agent和Authorization头部
    headers = {
        "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
        "Authorization": f"Bearer {token}"
    }

    # 发送签到请求
    sign_response = requests.get(sign_url, headers=headers)

    # 检查签到是否成功
    if sign_response.status_code == 200:
        # 打印签到成功后的结果
        print("签到成功，响应内容:")
        print(sign_response.text)
    else:
        print(f"签到失败，状态码: {sign_response.status_code}")
        print("响应内容:")
        print(sign_response.text)
else:
    print(f"登录失败，状态码: {login_response.status_code}")
    print("响应内容:")
    print(login_response.text)